package org.itzheng.itplayer.adapter.viewholder;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import org.itzheng.and.recyclerview.adapter.BaseRecyclerAdapter;

import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;

/**
 * Title:不需要ViewHolder的适配器<br>
 * Description: <br>
 *
 * @email ItZheng@ZoHo.com
 * Created by itzheng on 2020-6-10.
 */
public abstract class VHRecyclerAdapter extends BaseRecyclerAdapter<ViewHolder> {
    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder(onCreateView(parent, viewType));
    }

    protected static View inflate(ViewGroup parent, @LayoutRes int resource) {
        return LayoutInflater.from(parent.getContext()).inflate(resource, parent, false);
    }
}
